Various screen sizes of electronic devices result in various types of logical DPI of the electronic devices. However, a screen size and logical DPI of one electronic device are fixed. Because a third-party application (such as an application Facebook) may be installed on electronic devices having screens of different sizes, the third-party application needs to support multiple types of DPI, and a value range of the multiple types of DPI needs to include multiple types of logical DPI of different electronic devices.
Although the third-party application supports multiple types of DPI, when a user interface of the third-party application is displayed on an electronic device, DPI is usually read from a system read-only memory (Read-Only Memory, ROM), and the DPI stored in the system ROM is logical DPI. Therefore, the user interface of the third-party application is usually displayed on the electronic device by using only the logical DPI. In this way, data displayed on a screen is excessively large or excessively small for different users, and user experience is affected.
Currently, a user interface of a third-party application may be displayed on an electronic device in a user-defined adaptation mode by using DPI set by a user. However, automatic DPI adaptation cannot be implemented by using this method, and user experience deteriorates.